<script setup>
import { ref, computed } from 'vue'
import HomePanel from '@/views/Home/components/HomePanel.vue'
const catelist = ref([
  {
    id: 1,
    name: '分类1'
  },
  {
    id: 2,
    name: '分类2'
  },
  {
    id: 3,
    name: '分类3'
  },
  {
    id: 4,
    name: '分类4'
  }
])
const count = ref(10)
const loading = ref(false)

// const joblist = ref([

// ])
const joblist = ref([])
const noMore = computed(() => count.value >= joblist.value.length)
const disabled = computed(() => loading.value || noMore.value)
const load = () => {
  loading.value = true
  setTimeout(() => {
    count.value += 2
    loading.value = false
  }, 1000)
}
const joblistClick = (name) => {
  console.log(name)
}
</script>

<template>
  <div class="container">
    <div class="tabs">
      <el-tabs v-model="resentCateName" @tab-change="tab_change">
        <el-tab-pane
          v-for="cate in catelist"
          :key="cate.id"
          :name="cate.name"
          :label="cate.name"
        >
        </el-tab-pane>
      </el-tabs>
    </div>
    <div class="detail">
      <el-container>
        <el-aside>
          <div class="position-job-container" style="overflow: auto">
            <ul
              v-infinite-scroll="load"
              class="infinite-list"
              :infinite-scroll-disabled="disabled"
            >
              <li
                v-for="i in count"
                :key="i"
                class="infinite-list-item"
                @click="joblistClick('qq')"
              >
                <HomePanel
                  Jobname="运维实习生"
                  Salary="100-150/天"
                  loc="武汉"
                  logo="#"
                  companyName="华为"
                />
              </li>
            </ul>
            <p v-if="loading">Loading...</p>
            <p v-if="noMore">No more</p>
          </div>
        </el-aside>
        <el-main>
          <div class="job-detail-box">
            <el-container>
              <el-header>
                <div class="job-detail-header">
                  <div class="job-header-info">
                    <div class="job-detail-info">
                      <span class="job-name">项目助理</span>
                      <span class="job-salary">100-180/天</span>
                    </div>
                    <ul>
                      <li>
                        <i class="iconfont icon-map"></i>
                        <a href="#">武汉</a>
                      </li>
                      <li>
                        <i class="iconfont icon-work"></i>
                        本科
                      </li>
                    </ul>
                  </div>
                  <div class="job-detail-op">
                    <el-button type="primary" round="true">立即沟通</el-button>
                  </div>
                </div>
              </el-header>
              <el-main>
                <div class="littleTag">
                  <h3>职位描述</h3>
                  <ul>
                    <li v-for="i in 4" :key="i">keyword{{ i }}</li>
                  </ul>
                </div>
                岗位职责
                <br />
                1、开发和优化大模型，包括大语言模型、多模态模型等；
                <br />
                2、在LangChain框架下实现模型训练和推理，并优化系统性能；
                <br />
                3、与团队其他成员合作，共同完成项目开发和迭代。
                <br />
                基本要求
                <br />
                1、计算机科学、人工智能或相关领域
                <br />
                2、对大模型原理有基本理解
                <br />
                3、对LangChain框架有基本的了解和使用经验
                <br />
                4、熟练掌握Python编程，具备良好的代码质量和风格
                <br />
                5、对机器学习有基本的理解，了解常见的机器学习算法和模型
              </el-main>
              <el-footer>
                <div class="job-boss-info">
                  <div class="detail-figure">
                    <img src="#" />
                  </div>
                  <h2 class="name">田先生</h2>
                  <div class="boss-info-attr">任子行 · hr</div>
                </div>
              </el-footer>
            </el-container>
          </div>
        </el-main>
      </el-container>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.container {
  box-sizing: border-box;
  align-items: center;
  .tabs {
    box-sizing: border-box;
    align-items: center;
    padding: 0 20px;
    background-color: #fff;
    border-radius: 12px;
  }
  .detail {
    width: 1200px;
    margin: 16px auto 0;
    border-radius: 12px;
    padding: 20px 40px;
    box-sizing: border-box;
    align-items: center;
    .el-container {
      .el-aside {
        ::-webkit-scrollbar {
          width: 0px;
        }
        .position-job-container {
          height: 700px;
          text-align: center;
          ul {
            margin-block-start: 1em;
            margin-block-end: 1em;
            margin-inline-start: 0px;
            margin-inline-end: 0px;
            padding-inline-start: 40px;
            unicode-bidi: isolate;
            li {
              border-radius: 12px;
              cursor: pointer;
              background: #fff;
              transition: box-shadow 0.2s linear;
              z-index: 1;
              border: 1px;
              background: #f8f8f8;
              margin-bottom: 10px;
              .home-panel {
                border-radius: 12px;
              }
            }
            li:hover {
              box-shadow: 0 20px 16px 0 hsla(0, 0%, 70.2%, 0.2);
            }
          }
        }
      }
      .el-main {
        .job-detail-box {
          background: #fff;
          border-radius: 12px;
          padding: 20px 30px;
          height: 700px;
          .el-container {
            .el-header {
              .job-detail-header {
                display: flex;
                justify-content: space-between;
                align-items: center;
                padding: 16px 30px;
                border-radius: 16px 16px 0 0;
                transition: box-shadow 0.2s linear;
                .job-detail-info {
                  display: flex;
                  align-items: center;
                  margin-right: 8px;
                  .job-name {
                    font-size: 20px;
                    font-weight: 600;
                    color: #222;
                    line-height: 28px;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                  }
                  .job-salary {
                    font-size: 24px;
                    font-family: kanzhun-Regular;
                    color: #fe574a;
                    line-height: 29px;
                    flex-shrink: 0;
                    margin-left: 20px;
                  }
                }
                ul {
                  overflow: hidden;
                  height: 20px;
                  margin-top: 12px;
                  display: flex;
                  li {
                    position: relative;
                    color: #222;
                    line-height: 20px;
                    font-size: 14px;
                    display: flex;
                    align-items: center;
                    margin-left: 20px;
                    i {
                      display: inline-block;
                      width: 16px;
                      height: 16px;
                      margin-right: 6px;
                    }
                  }
                }
              }
            }
            .el-main {
              white-space: pre-wrap;
              word-break: break-all;
              margin-top: 20px;
              margin-bottom: 20px;
              line-height: 28px;
              color: #333;
              font-size: 15px;
              text-align: justify;
              letter-spacing: 0;
              .littleTag {
                ul {
                  display: flex;
                  overflow: hidden;
                  margin-top: -8px;
                  li {
                    margin-top: 8px;
                    margin-right: 8px;
                    font-size: 14px;
                    color: #666;
                    line-height: 20px;
                    float: left;
                    padding: 4px 12px;
                    white-space: nowrap;
                    background: #f8f8f8;
                    border-radius: 4px;
                  }
                }
              }
            }
            .el-footer {
              .job-boss-info {
                border-top: 1px solid #ededed;
                padding-top: 16px;
                margin-top: 24px;
                .detail-figure {
                  float: left;
                  display: flex;
                  align-items: center;
                  justify-content: center;
                  margin-right: 12px;
                  border: 1px solid #f6fdfd;
                  border-radius: 100%;
                  img {
                    width: 40px;
                    height: 40px;
                    display: block;
                    border-radius: 100%;
                  }
                }
                .name {
                  font-size: 16px;
                  font-weight: 500;
                  color: #222;
                  line-height: 22px;
                  display: flex;
                  align-items: center;
                }
                .boss-info-attr {
                  font-size: 12px;
                  color: #666;
                  line-height: 17px;
                  margin-top: 4px;
                  display: flex;
                  align-items: center;
                }
              }
            }
          }
        }
      }
    }
  }
}
</style>
